package com.xpsoft.oa.service.produce.impl;


import java.util.List;

import com.xpsoft.core.service.impl.BaseServiceImpl;
import com.xpsoft.oa.dao.produce.ArticleSendDao;
import com.xpsoft.oa.model.produce.ArticleSend;
import com.xpsoft.oa.service.produce.ArticleSendService;

public class ArticleSendServiceImpl extends BaseServiceImpl<ArticleSend> implements ArticleSendService{
	private ArticleSendDao dao;
	
	public ArticleSendServiceImpl(ArticleSendDao dao) {
		super(dao);
		this.dao=dao;
	}

	@Override
	public ArticleSend getByRegId(Long regId) {
		String hql = "from ArticleSend where articleReg.id=?";
		List<ArticleSend> sendList = dao.findByHql(hql, new Object[]{regId});
		if(sendList!=null&&sendList.size()>0){
			return sendList.get(0);
		}
		return null;
	}
	

}